package com.amazon.ags.client.profiles;

import android.content.Context;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import com.amazon.ags.api.ErrorCode;
import com.amazon.ags.api.RequestResponse;
import com.amazon.ags.client.BaseReplyMessengerFactory;

public class ProfilesReplyMessengerFactory<T extends RequestResponse> extends BaseReplyMessengerFactory<T>
{
  private static final String FEATURE_NAME = "PROFILES";
  private static final String TAG = "PROFILES_" + ProfilesReplyMessengerFactory.class.getSimpleName();

  public ProfilesReplyMessengerFactory(Context paramContext)
  {
    super(paramContext);
  }

  protected T processMessage(Message paramMessage)
  {
    Bundle localBundle = paramMessage.getData();
    int i = paramMessage.arg1;
    Log.d(TAG, "Processing incoming service response message of type: " + paramMessage.what + " and responseCode: " + i);
    switch (paramMessage.what)
    {
    default:
      Log.e(TAG, "Illegal value received for request type parameter: " + paramMessage.what);
      throw new IllegalArgumentException("Received an invalid value for request type parameter");
    case 18:
    }
    if (i != 17)
    {
      int j = paramMessage.arg2;
      Log.d(TAG, "The service request was a failure with code " + j + ", constructing failure response");
      return new RequestPlayerProfileResponseImp(j, ErrorCode.fromServiceResponseCode(j));
    }
    return unbundleRequestPlayerProfileResponse(localBundle, i);
  }

  public T unbundleRequestPlayerProfileResponse(Bundle paramBundle, int paramInt)
  {
    return new RequestPlayerProfileResponseImp(new PlayerImpl(paramBundle.getString("ALIAS")), paramInt);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.ags.client.profiles.ProfilesReplyMessengerFactory
 * JD-Core Version:    0.6.2
 */